import random

award = 1000
lis = [1]

for i in lis:
    lis.append(i)
    dice = random.sample(range(1,6),3)
    sum = dice[0] + dice[1] + dice[2]
    str1 = input("请猜大小，输入exit退出")
    if str1 == exit:
        break
    elif str1 == "大":
        x = 0
    elif str1 == "小":
        x = 1
    if 3 <= sum <= 10:
        x1 = 1
    if 11 <= sum <= 18:
        x1 = 0
    if x1 == x:
        award == award + 100
        print("恭喜你猜对了，获得100金豆")
        win = 0
        win = win + 1
    else:
        award == award - 100
        print("猜错了，失去100金豆")
        lose = 0
        lose = lose + 1
    if award < 100:
        print("您的金豆不足，请充值,否则自动退出游戏")
        break
        print(f"金豆数:{award}")
        print(win/(win+lose))
    
